-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize path handling #122
Conversation
realpath() resolves any and all symlinks in the path; in situations where we just need to store or print an absolute path, we should use abspath() instead. Signed-off-by: John Pennycook <[email protected]>
Now that we no longer use realpath() when locating files, there is a possibility that paths will still contain symlinks when we read them. Signed-off-by: John Pennycook <[email protected]>
I'm seeing a few unexpected differences in computed divergence after this change, so I'm converting this to a draft until I can figure out what's going on. |
Reintroduce realpath() when searching for information we have stored about files, to ensure that platform information propagates through symlinks to the original files. Signed-off-by: John Pennycook <[email protected]>
The issue was that without Reintroducing I suspect there are opportunities to optimize things further by hoisting some of these |
Significantly improves performance by further reducing the number of calls to realpath. Signed-off-by: John Pennycook <[email protected]>
Signed-off-by: John Pennycook <[email protected]>
I realized this morning that it would actually be very easy to cache computed realpaths inside of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Related issues
Closes #114.
Proposed changes
abspath
instead ofrealpath
when resolving symlinks is unnecessary.open
.